// __PUBLIC__/js/page/admin/admin/registereduser
require(['../../common'], function() {
  require(['admin.registereduser'])
})

define('admin.registereduser', [
  'jquery',
  'page/grid'
], function($, Grid) {
  'use strict';
  var $table = $('.table')
  var mygrid = new Grid($table)
  mygrid.init()

  function getSelected() {
    var selected = mygrid.getSelected()
    if (!selected.count) {
      alert(lang.pleaseSelectAData)
      return
    }
    return selected
  }

  function getASelected(t) {
    var current = mygrid.getCurrent(t)
    var selected = {
      id: [current.id],
      index: [current.index]
    }
    console.log(selected)
    return selected
  }
  
  $(document)
    .on('click', '#J_search', function(e) {
      e.preventDefault()
       sureSearchAttach()
    })
   
  function sureSearchAttach() {
    var phone = $('#phone').val()
    var nickname = $('#nickname').val()
    var str_get ='& phone=' + phone +'&nickname='+nickname
    location.href = APP + '?app=admin&m=RegisteredUser&a=registeredUser' + str_get
  }
})
